<?php


/**
 * This class defines the structure of the 'user_team' table.
 *
 *
 *
 * This map class is used by Propel to do runtime db structure discovery.
 * For example, the createSelectSql() method checks the type of a given column used in an
 * ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
 * (i.e. if it's a text column type).
 *
 * @package    orm.map
 */
class UserTeamTableMap extends TableMap {

	/**
	 * The (dot-path) name of this class
	 */
	const CLASS_NAME = 'orm.map.UserTeamTableMap';

	/**
	 * Initialize the table attributes, columns and validators
	 * Relations are not initialized by this method since they are lazy loaded
	 *
	 * @return     void
	 * @throws     PropelException
	 */
	public function initialize()
	{
	  // attributes
		$this->setName('user_team');
		$this->setPhpName('UserTeam');
		$this->setClassname('UserTeam');
		$this->setPackage('orm');
		$this->setUseIdGenerator(true);
		// columns
		$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, 11, null);
		$this->addForeignKey('USER_ID', 'UserId', 'INTEGER', 'user', 'ID', false, 11, null);
		$this->addColumn('NAME', 'Name', 'VARCHAR', false, 30, null);
		$this->addColumn('TOURNAMENT_ID', 'TournamentId', 'INTEGER', false, 11, null);
		$this->addColumn('TOTAL_POINTS', 'TotalPoints', 'INTEGER', false, 11, null);
		$this->addColumn('PURCHASED_VALUE', 'PurchasedValue', 'INTEGER', false, 10, null);
		$this->addColumn('CURRENT_VALUE', 'CurrentValue', 'INTEGER', false, 10, null);
		$this->addColumn('IS_ACTIVE', 'IsActive', 'CHAR', false, 1, 'Y');
		$this->addColumn('IS_DELETE', 'IsDelete', 'CHAR', false, 1, 'N');
		$this->addColumn('GAME_TYPE', 'GameType', 'VARCHAR', false, 20, null);
		$this->addColumn('CURRENT_RANKING', 'CurrentRanking', 'INTEGER', false, 11, null);
		$this->addColumn('PREVIOUS_RANKING', 'PreviousRanking', 'INTEGER', false, 11, null);
		$this->addColumn('CREATED_DATE', 'CreatedDate', 'DATE', false, null, null);
		// validators
	} // initialize()

	/**
	 * Build the RelationMap objects for this table relationships
	 */
	public function buildRelations()
	{
    $this->addRelation('User', 'User', RelationMap::MANY_TO_ONE, array('user_id' => 'id', ), null, null);
    $this->addRelation('UserTeamPlayer', 'UserTeamPlayer', RelationMap::ONE_TO_MANY, array('id' => 'user_team_id', ), null, null);
    $this->addRelation('UserTeamPlayerHistory', 'UserTeamPlayerHistory', RelationMap::ONE_TO_MANY, array('id' => 'user_team_id', ), null, null);
    $this->addRelation('Substitute', 'Substitute', RelationMap::ONE_TO_MANY, array('id' => 'user_team_id', ), null, null);
	} // buildRelations()

} // UserTeamTableMap
